package com.java0430;

public class TestTeacher {

    public static void main(String[] args) {
        //创建学生对象，调用有参的构造方法给属性赋值
        Student student = new Student("张小三",18,"男","计算机");
        //调用父类的方法
        student.eat();
        student.speak();
        //调用自身方法
        student.study();

        //创建老师对象
        Teacher teacher = new Teacher("李四",30,"女","数学");
        teacher.eat();
        teacher.speak();
        teacher.teach();
    }
}